﻿// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.SafeNativeHandle
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 8E14765A-6610-409A-BA36-099A0642905D
// Assembly location: E:\git\ALLIDA\windll\infocard.exe

using Microsoft.Win32.SafeHandles;
using System;

namespace Microsoft.InfoCards
{
  internal sealed class SafeNativeHandle : SafeHandleZeroOrMinusOneIsInvalid
  {
    private SafeNativeHandle()
      : base(true)
    {
    }

    public SafeNativeHandle(IntPtr existingHandle, bool ownsHandle)
      : base(ownsHandle)
    {
      this.SetHandle(existingHandle);
    }

    protected override bool ReleaseHandle()
    {
      return NativeMethods.SafeHandleOnlyMethods.CloseHandle(this.handle);
    }
  }
}
